package string;

public class SubstringDemo {
    public static void main(String[] args) {
        String str = "www.tedu.cn";
        String sub = str.substring(4,8);
        System.out.println(sub);  //tedu

        sub = str.substring(4);  //从下标4开始，一直截到字符串末尾
        System.out.println(sub);  //tedu.cn
    }
}
